Skip to content

[#200] ProfileView에 분기 활동을 주 단위로 그래프를 통해 보여주도록 구현한다#208

Merged
opficdev merged 9 commits intodevelopfrom
feat/#ProfileView-Graph
Mar 6, 2026
Merged

[#200] ProfileView에 분기 활동을 주 단위로 그래프를 통해 보여주도록 구현한다#208
opficdev merged 9 commits intodevelopfrom
feat/#ProfileView-Graph

Conversation

@opficdev
Copy link
Copy Markdown
Owner

@opficdev opficdev commented Mar 6, 2026

@opficdev opficdev self-assigned this Mar 6, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 ProfileView에 주간 활동 추세 그래프를 도입하여 사용자가 자신의 작업 생성 및 완료 패턴을 시각적으로 파악할 수 있도록 합니다. 또한, 분기 탐색 및 선택 기능을 개선하여 특정 기간의 활동 데이터를 더욱 쉽게 조회하고 관리할 수 있도록 사용자 인터페이스와 백엔드 로직을 업데이트했습니다.

Highlights

  • 주간 활동 추세 그래프 추가: 프로필 뷰에 사용자의 주간 활동(생성 및 완료된 작업) 추세를 시각적으로 보여주는 새로운 그래프를 구현했습니다.
  • 분기 선택 기능 개선: 연도와 분기를 직접 선택할 수 있는 전용 분기 선택 시트를 추가하여 분기 탐색 기능을 향상시켰습니다. 또한 현재 분기로 빠르게 돌아갈 수 있는 버튼도 추가되었습니다.
  • 활동 데이터 처리 로직 강화: 가장 오래된 활동 분기를 가져오는 로직과 선택 가능한 분기 범위를 제한하는 로직을 ProfileViewModel에 추가하여 데이터 일관성과 사용자 경험을 개선했습니다.
  • 새로운 데이터 모델 도입: 주간 활동 데이터를 효율적으로 관리하고 그래프에 표시하기 위한 ProfileWeeklyTrendPoint 구조체를 새로 정의했습니다.
Changelog
  • DevLog/Presentation/Structure/Profile/ProfileCompletionQuarter.swift
    • 주간 트렌드 포인트를 계산하는 weeklyTrendPoints 속성 및 makeWeeklyTrendPoints 정적 메서드를 추가했습니다.
  • DevLog/Presentation/Structure/Profile/ProfileWeeklyTrendPoint.swift
    • 주간 활동 추세 그래프의 데이터 포인트를 나타내는 ProfileWeeklyTrendPoint 구조체를 새로 추가했습니다.
  • DevLog/Presentation/Structure/RecentTodoItem.swift
    • 파일 생성자 주석을 업데이트했습니다.
  • DevLog/Presentation/ViewModel/ProfileViewModel.swift
    • 분기 선택 UI 상태를 관리하는 새로운 상태 변수들을 추가했습니다.
    • 분기 선택 및 가장 오래된 분기 데이터를 가져오는 새로운 액션 및 사이드 이펙트를 정의했습니다.
    • 분기 탐색 로직을 updateSelectedQuarter 헬퍼 함수로 리팩토링했습니다.
    • 계산된 속성들을 확장(extension)으로 이동하여 코드 구조를 개선했습니다.
    • 가장 오래된 활동 분기를 가져오고 선택 가능한 분기를 검증하는 로직을 구현했습니다.
  • DevLog/Resource/Localizable.xcstrings
    • 새로운 UI 요소(예: '주간 추세', '연도', '분기 선택', '활동 히트맵')에 대한 지역화 키를 추가했습니다.
  • DevLog/UI/Profile/ProfileHeatmapView.swift
    • 히트맵 섹션에 '활동 히트맵' 제목을 추가하고 패딩을 조정했습니다.
  • DevLog/UI/Profile/ProfileTrendChartView.swift
    • 주간 활동 추세 그래프를 표시하는 ProfileTrendChartView SwiftUI 뷰를 새로 추가했습니다.
  • DevLog/UI/Profile/ProfileView.swift
    • 포커스 상태 변수 이름을 focusedOnStatusMessageTextField에서 focused로 변경했습니다.
    • 상태 메시지 초기화 버튼의 활성화 조건을 수정했습니다.
    • ProfileTrendChartView를 통합하여 주간 추세 그래프를 표시하도록 했습니다.
    • 현재 분기로 돌아가는 버튼을 추가했습니다.
    • 활동 유형 선택기를 토글(Toggle) 기반으로 변경하고, 단일 활동 유형 선택 시 비활성화 로직을 추가했습니다.
    • 분기 선택 버튼과 분기 선택 시트를 구현하여 분기 탐색 UI를 개선했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

프로필 화면에 분기별 활동을 주간 단위로 보여주는 그래프를 추가하는 변경사항을 확인했습니다. 전반적으로 코드 구조가 잘 잡혀있고, 특히 ViewModel과 View가 잘 분리되어 새로운 기능이 깔끔하게 통합되었습니다. 몇 가지 코드 중복 제거 및 하드코딩된 문자열을 지역화하는 부분에 대한 개선점을 제안합니다. 이러한 부분을 수정하면 코드의 유지보수성과 확장성이 더욱 향상될 것입니다.

let year = calendar.component(.year, from: start)
let month = calendar.component(.month, from: start)
let quarter = ((month - 1) / 3) + 1
return "\(year) Q\(quarter)"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

분기(Quarter)를 나타내는 문자열 "Q"가 하드코딩되어 있습니다. Localizable.xcstringsQ%lld 키가 추가되었으므로, 이를 활용하여 지역화(Localization)를 지원하도록 수정하는 것이 좋습니다. 이렇게 하면 다른 언어로 번역이 필요할 때 쉽게 대응할 수 있습니다.

Suggested change
return "\(year) Q\(quarter)"
return "\(year) \(String(format: NSLocalizedString("Q%lld", comment: ""), quarter))"

.foregroundStyle(.quaternary)
AxisValueLabel {
if let weekIndex = value.as(Int.self) {
Text("\(weekIndex)주")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

X축 레이블에 사용된 '주'라는 문자열이 하드코딩되어 있습니다. Localizable.xcstrings"%lld주" 키가 있으므로 이를 사용하여 지역화 처리를 하는 것이 좋습니다. 이렇게 하면 유지보수성과 다국어 지원에 유리합니다.

Suggested change
Text("\(weekIndex)")
Text(String(format: NSLocalizedString("%lld주", comment: ""), weekIndex))

private var createdSeries: some ChartContent {
ForEach(trendPoints) { point in
LineMark(
x: .value("주차", point.weekIndex),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

차트의 X축 값에 대한 설명으로 "주차" 문자열이 하드코딩되어 있습니다. 이 문자열은 사용자에게 직접 보이지 않을 수 있지만, 디버깅이나 향후 차트 라이브러리 변경 시 중요할 수 있습니다. Localizable.xcstrings에 있는 "주차" 키를 사용하여 지역화하는 것을 권장합니다. 이 피드백은 completedSeries에도 동일하게 적용됩니다.

Suggested change
x: .value("주차", point.weekIndex),
x: .value(NSLocalizedString("주차", comment: ""), point.weekIndex),

set: { viewModel.send(.setQuarterPickerYear($0)) }
)) {
ForEach(viewModel.availableQuarterYears, id: \.self) { year in
Text(year.formatted(.number.grouping(.never)) + "년").tag(year)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

연도를 표시하는 부분에서 '년'이 하드코딩되어 있습니다. 다국어 지원 및 유지보수를 위해 Localizable.xcstrings"%@년"과 같은 형식의 키를 추가하고 이를 코드에서 사용하는 것을 권장합니다.

Suggested change
Text(year.formatted(.number.grouping(.never)) + "").tag(year)
Text("\(year.formatted(.number.grouping(.never)))").tag(year) // Localizable.xcstrings에 "%@년" 키를 추가하고 NSLocalizedString을 사용하도록 수정 제안

guard let quarterStart else { return }
viewModel.send(.selectQuarter(quarterStart))
} label: {
Text("Q\(quarter)")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

분기 선택 버튼의 라벨에 "Q"가 하드코딩되어 있습니다. Localizable.xcstringsQ%lld 키가 정의되어 있으므로, 이를 사용하여 지역화된 문자열을 생성하는 것이 좋습니다.

Suggested change
Text("Q\(quarter)")
Text(String(format: NSLocalizedString("Q%lld", comment: ""), quarter))

@opficdev opficdev merged commit 11508e2 into develop Mar 6, 2026
1 check passed
@opficdev opficdev deleted the feat/#ProfileView-Graph branch March 6, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ProfileView에 분기 활동을 주 단위로 그래프를 통해 보여주도록 구현한다

1 participant